<?php

namespace App;

use Library\Response;

abstract class Controller
{
    /**
     * @param string $message
     * @param mixed|null $result
     * @param int $code
     * @return Response
     */
    protected function success(string $message = "", mixed $result = null, int $code = 200): Response
    {
        return response()->success($message, $result, $code);
    }

    /**
     * @param string $message
     * @param mixed|null $result
     * @param int $code
     * @return Response
     */
    protected function error(string $message = "", mixed $result = null, int $code = 200): Response
    {
        return response()->error($message, $result, $code);
    }

    /**
     * @param mixed|null $result
     * @return Response
     */
    protected function result(mixed $result = null): Response
    {
        return response()->result($result);
    }
}